﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace FAST
{
    [Serializable()]
    public class FolderHandler : FilesHandler
    {
        private string fullFolderPath;
        private string subFolderPath;//exclude root path
        private DirectoryInfo di;
        private bool dirtyBit;
        private int status;

        //default constructor
        public FolderHandler()
        {
            fullFolderPath = "";
            subFolderPath = "";
            this.di = null;
            dirtyBit = false;
            status = 7; //NOT_EXIST
            setFileType(IS_FOLDER);
        }

        public FolderHandler(string fullFolderPath, string subFolderPath)
        {
            this.fullFolderPath = fullFolderPath;
            this.subFolderPath = subFolderPath;
            this.di = new DirectoryInfo(fullFolderPath);
            this.dirtyBit = false;
            this.status = 7; //NOT_EXIST
            setFileType(IS_FOLDER);
        }

        public FolderHandler(string fullFolderPath, string subFolderPath, DirectoryInfo fi, bool dirtyBit, int status)
        {
            this.fullFolderPath = fullFolderPath;
            this.subFolderPath = subFolderPath;
            this.di = fi;
            this.dirtyBit = dirtyBit;
            this.status = status;
            setFileType(IS_FOLDER);
        }

        //Overload constructor for Comparing object
        public FolderHandler(string fullFolderPath)
        {
            this.fullFolderPath = fullFolderPath;
            setFileType(IS_FOLDER);
        }

        public int getFolderStatus()
        {
            return this.status;
        }

        public string getSubFolderPath()
        {
            return this.subFolderPath;
        }

        public string getFullFolderPath()
        {
            return this.fullFolderPath;
        }

        public void setSubFolderPath(string subFolderPath)
        {

            this.subFolderPath = subFolderPath;
        }

        public DirectoryInfo getDi()
        {
            return this.di;
        }

        public void setDi(DirectoryInfo di)
        {
            this.di = di;
        }


        public bool getDirtyBit()
        {
            return this.dirtyBit;
        }

        public void setDirtyBit(bool dirtyBit)
        {
            this.dirtyBit = dirtyBit;
        }

        public void setFolderStatus(int status)
        {
            this.status = status;
        }

    }
}
